package com.foundersoftware.component.impl;

import java.util.List;

import javax.servlet.ServletContext;


import com.foundersoftware.component.IComponentParseExcel;
import com.foundersoftware.parser.excel.IParserExcel;
import com.foundersoftware.parser.excel.impl.ParserExcelImpl;
import com.foundersoftware.template.excel.IParserTemplate;
import com.foundersoftware.template.excel.imple.ParserTemplateImpl;
/**
 * The Class implement IComponentParseExcel interface,
 * disposal parser excel logic.
 * @author JiDong
 * @create December 2.2009
 *
 */
public class ComponentParseExcel implements IComponentParseExcel{
	
	private ServletContext servletContext;
	
	public ServletContext getServletContext() {
		return servletContext;
	}

	public void setServletContext(ServletContext servletContext) {
		this.servletContext = servletContext;
	}

	public void exportExcel(List<Object> exportData, String templateName,ServletContext servletContext) {
		
		IParserTemplate parserTemplate = new ParserTemplateImpl();
		IParserExcel	parserExcel = new ParserExcelImpl();
		 
		parserTemplate.findTemplateByTemplateName(templateName, servletContext);
		parserExcel.exportExcel(exportData,parserTemplate);
	}

}
